import { createApp } from 'vue';
import { createPinia } from "pinia";
import piniaPersist from 'pinia-plugin-persist'
import router from './router' // 路由
import App from './App.vue';
import 'element-plus/dist/index.css'
import './assets/css/base.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import ECharts from 'vue-echarts'  // 引入ECharts
import "echarts";                  // 全局引入echarts

const app = createApp(App)
let icons = []
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    icons.push(key);
    app.component(key, component)
}
localStorage.icons = JSON.stringify(icons)
app.component('ECharts',ECharts)    
const pinia = createPinia()
pinia.use(piniaPersist)

app.use(pinia);
app.use(router);
app.mount("#app"); 